"use client"

import { useState } from "react"
import { Button } from "@/components/ui/button"
import { Input } from "@/components/ui/input"

interface LoginPageProps {
  onLogin: () => void
}

export function LoginPage({ onLogin }: LoginPageProps) {
  const [email, setEmail] = useState("")
  const [password, setPassword] = useState("")

  return (
    <div className="min-h-screen bg-white p-8">
      <div className="max-w-6xl mx-auto">
        {/* Header */}
        <div className="border-b border-gray-200 pb-6 mb-12">
          <div className="flex items-center justify-between">
            <div className="flex items-center space-x-4">
              <div className="w-8 h-8 bg-orange-500 rounded"></div>
              <span className="text-sm font-medium">ESP32 TRAINING</span>
            </div>
            <div className="flex items-center space-x-6 text-sm">
              <span>训练系统</span>
              <span>数据分析</span>
              <span>设备管理</span>
            </div>
          </div>
        </div>

        {/* Main Content */}
        <div className="grid grid-cols-12 gap-8 min-h-[600px]">
          {/* Left Sidebar */}
          <div className="col-span-3 border-r border-gray-200 pr-8">
            <div className="mb-8">
              <h3 className="text-sm font-medium text-gray-600 mb-4">系统概览</h3>
              <div className="space-y-3 text-sm">
                <div>• 物理交互训练</div>
                <div>• 实时反应测量</div>
                <div>• 数据驱动分析</div>
              </div>
            </div>
          </div>

          {/* Main Area */}
          <div className="col-span-6">
            <div className="mb-12">
              <h1 className="text-6xl font-bold text-black mb-4 tracking-tight">
                REACTION_
                <br />
                TRAINING
              </h1>
              <p className="text-gray-600 text-lg">通过ESP32设备进行专业反应力训练</p>
            </div>

            {/* Login Form */}
            <div className="border border-gray-200 p-8">
              <div className="flex items-center justify-between mb-6">
                <h2 className="text-xl font-bold">用户登录</h2>
                <div className="w-3 h-3 bg-orange-500 rounded-full"></div>
              </div>

              <div className="space-y-6">
                <div>
                  <label className="block text-sm font-medium text-gray-700 mb-2">邮箱地址</label>
                  <Input
                    type="email"
                    value={email}
                    onChange={(e) => setEmail(e.target.value)}
                    className="w-full h-12 border-gray-300 rounded-none focus:border-orange-500 focus:ring-orange-500"
                  />
                </div>
                <div>
                  <label className="block text-sm font-medium text-gray-700 mb-2">密码</label>
                  <Input
                    type="password"
                    value={password}
                    onChange={(e) => setPassword(e.target.value)}
                    className="w-full h-12 border-gray-300 rounded-none focus:border-orange-500 focus:ring-orange-500"
                  />
                </div>
                <Button
                  onClick={onLogin}
                  className="w-full h-12 bg-orange-500 hover:bg-orange-600 text-white font-medium rounded-none"
                >
                  开始训练
                </Button>
              </div>
            </div>
          </div>

          {/* Right Sidebar */}
          <div className="col-span-3 pl-8 border-l border-gray-200">
            <div className="mb-8">
              <h3 className="text-sm font-medium text-gray-600 mb-4">系统特性</h3>
              <div className="space-y-4">
                <div className="border border-gray-200 p-4">
                  <div className="text-2xl font-bold text-black mb-1">8</div>
                  <div className="text-sm text-gray-600">LED训练点</div>
                </div>
                <div className="border border-gray-200 p-4">
                  <div className="text-2xl font-bold text-black mb-1">1ms</div>
                  <div className="text-sm text-gray-600">精度测量</div>
                </div>
                <div className="border border-gray-200 p-4">
                  <div className="text-2xl font-bold text-black mb-1">100%</div>
                  <div className="text-sm text-gray-600">实时反馈</div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  )
}
